<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<title>show.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <script src="jquery-1.7.2.js"></script>
    <script src="high.lazyload.js"></script>
<script>


    $(document).ready(function(){
       $('img').lazyload(
        {
         placeholder : "grey.gif",
         effect : "fadeIn"
        }
       );
    });
    
    
    
    var request = {getString:function(para,display){
    var uri = window.location.search;
    var url = window.location.href;
    var dis = display;
    if(dis!=null && dis == true){
        //alert("参数链接是 : " + uri);
        //alert("全部链接是 : " + url);
    }
    var re = new RegExp("" + para + "=([^&?]*)", "ig");
    return ((uri.match(re))?(uri.match(re)[0].substr(para.length + 1)):null);
    }};
    //alert(request.getString('name',true));
    
    
    
    
    function test(){
        var test = document.getElementById("test");
        //test.innerHTML = "传递过来的参数是： " + request.getString('name',true);
        
        var num = Number(request.getString('divnum',true));
        //alert(num);
        var s = "";
        
        for(var i=0; i<num; i++){
            //s += "<div id='" + i + "'>abc</div><br>";
            
            s += "abc<img class='pic' id='pic" + i + "'></img><br>";
            
            
            
        }
        //alert(s);
        test.innerHTML = s;
    }
    
    function test2(){
        var testDiv = document.getElementById("pic2");
        testDiv.src = "http://192.168.0.103/pto/001.jpg";
    }
    
    
    function testJquery(){
        //alert("dddddddddddddd");
        //$("#test").html("");
        $.getJSON(
        "http://192.168.0.103/pto/show.php",
        function action(data){
            //alert(data.picnum);
            //var urllist = data.urllist;
            
            var urllist = eval(data.urllist);
            var s = "";
            $.each(urllist, function (i,o) {
                //alert("id:" + i + "  name:" + o.name + "  url:" + o.url);
                s += "<img class='pic' id='pic" + i + "' src='" + o.url + "'></img><br>";
            });
            //alert(s);
            $("#test").html(s);
            
            //var test = document.getElementById("test");
            //test.innerHTML = s;
            
            //alert(data.urllist.size());
            
            
            
            //for(var i=0;i<1;i++){
                //for(var key in urllist[0]){
                 　　//alert("key："+key+",value："+jsonList[i][key]);
                //}
            //}
            
        }
        );
    }
</script>

<style>
    .pic{
        color: red;
        border-color: red;
        border-width: 1px;
        border-style: solid;
    }
    
</style>
</head>
<body>

<hr></hr>

<div id="test">

</div>
<input value="test" type="button" onclick="test();return false;" />

<input value="testDiv" type="button" onclick="test2();return false;" />

<input value="testJquery" type="button" onclick="testJquery();return false;" />
<img src="http://192.168.0.103/pto/007.jpg"/>
</body>
</html>